package com.dragonsky.shop.user.controller;

import com.dragonsky.shop.common.utils.AjaxResult;
import com.dragonsky.shop.openfeign.user.param.UserInfoParam;
import com.dragonsky.shop.openfeign.user.vo.UserInfoVo;
import com.dragonsky.shop.user.service.UserFeignService;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/userFeign")
public class UserFeignController {

    @Resource
    private UserFeignService userFeignService;


    @GetMapping("/userName")
    AjaxResult<String> userName(@RequestParam(value = "userName", required = false) String userName) {
        return userFeignService.userName(userName);
    }

    @GetMapping("/userInfo")
    AjaxResult<UserInfoVo> userInfo(UserInfoParam userInfoParam) {
        return userFeignService.userInfo(userInfoParam);
    }

    @PostMapping("/userInfo2")
    AjaxResult<UserInfoVo> userInfo2(UserInfoParam userInfoParam) {
        return userFeignService.userInfo2(userInfoParam);
    }

    @PostMapping("/userInfo3")
    AjaxResult<UserInfoVo> userInfo3(@RequestBody UserInfoParam userInfoParam) {
        return userFeignService.userInfo3(userInfoParam);
    }

}
